﻿@model MyMvc.Model.Models.Relation

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>联系我们</title>
    <link href="~/Content/jquery-easyui-1.3.1/themes/icon.css" rel="stylesheet" />
    <link href="~/Content/jquery-easyui-1.3.1/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/Site.css" rel="stylesheet" />
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>

    <script src="~/Content/jquery-easyui-1.3.1/jquery-1.8.0.min.js"></script>
    <script src="~/Content/jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
    <script src="~/Content/jquery-easyui-1.3.1/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function () {
            ModifyAddress();

        });
        //实现修改的操作
        function ModifyAddress() {
            $("#btnModify").click(function () {
                //验证表单是否通过
                var validate = $('#ff').form('validate');
                //构造传递的参数，
                if (validate == false) {
                    return false;
                }
                else {
                    //构造传递的参数，
                    var postData = {
                        Adress: $("#Adress").val(),
                        Fax1: $("#Fax1").val(),
                        Mail1: $("#Mail1").val(),
                        Website1: $("#Website1").val(),
                        Telephone1: $("#Telephone1").val(),
                        Fax2: $("#Fax2").val(),
                        Mail2: $("#Mail2").val(),
                        Website2: $("#Website2").val(),
                        Telephone2: $("#Telephone2").val(),
                    };
                }
                //异步传递数据到前台进行添加
                $.post("/Company/ModifyRelation", postData, function (data) {
                    if (data == "OK") {
                        $.messager.alert("友情提示", "修改成功");
                    }
                    else {
                        $.messager.alert("友情提示", "修改失败，请您检查");
                    }
                });

            });
        }

    </script>
</head>
<body>
    <div align="center">
    <form id="ff" method="post" novalidate="novalidate">
            <table>
                <tr>
                    <td><h3><label for="Adress">地  址：</label></h3></td>
                    <td><input class="easyui-validatebox" type="text" id="Title" value="@Model.Adress" name="Adress" /></td>
                </tr>
                <tr>
                    <td><h3><label for="Fax">传  真：</label></h3></td>
                    <td><input class="easyui-validatebox" type="text" id="Fax1" value="@Model.Fax1" name="Fax1"  /></td>
                    
                </tr>
                <tr>
                    <td></td>
                    <td><input class="easyui-validatebox" type="text" id="Fax2" value="@Model.Fax2" name="Fax2"  /></td>
                </tr>
                <tr>
                    <td><h3><label for="Mail">邮  箱：</label></h3></td>
                    <td><input class="easyui-validatebox" type="email" id="Mail1" value="@Model.Mail1" name="Mail1"  /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input class="easyui-validatebox" type="email" id="Mail2" value="@Model.Mail2" name="Mail2" /></td>
                </tr>
                <tr>
                    <td><h3><label for="Website">网  址：</label></h3></td>
                    <td><input class="easyui-validatebox" type="url" id="Website1" value="@Model.Website1" name="Website1"   /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input class="easyui-validatebox" type="url" id="Website2" value="@Model.Website2" name="Website2"  /></td>
                </tr>
                <tr>
                    <td><h3><label for="Telephone">联系方式：</label></h3></td>
                    <td><input class="easyui-validatebox" type="text" id="Telephone1" value="@Model.Telephone1" name="Telephone2"  /></td>
                </tr>
                <tr><td></td><td><input class="easyui-validatebox" type="text" id="Telephone2" value="@Model.Telephone2" name="Telephone2"  /></td></tr>
                <tr>
                    <td><a href="#" class="easyui-linkbutton" id="btnModify" iconcls="icon-ok">更改</a></td>
                </tr>                
            </table>           
           
    </form>
        </div>
</body>
</html>
